package nl.vu.few.ibivu.biomodels.client.activity;

import nl.vu.few.ibivu.biomodels.client.place.ModellingPlace;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;
import com.google.inject.Inject;
import com.google.inject.Provider;

public class MenuActivityMapper implements ActivityMapper {
	@Inject Provider<MenuActivity> menuActivityProvider;
	
	@Override
	public Activity getActivity(Place place) {
		if (place instanceof ModellingPlace)
			return menuActivityProvider.get().isModelling();
		
		return menuActivityProvider.get().isBrowsing();
	}

}
